const express = require('express');
const router = express.Router();
const carController = require("../controller/carController.js");
//处理图片上传
const multer = require("multer");
const Car = multer({dest:"./img/Car/"});
// 获取汽车列表
router.post('/list',carController.GetCarList);
// 增加汽车
router.post('',Car.single('file'),carController.AddCar);
// 修改汽车
router.put('',Car.single('file'),carController.EditCar);
// 删除汽车
router.delete('',carController.DeleteCar);
// 批量删除汽车
router.delete('/BatchDeleteCar',carController.BatchDeleteCar);
// 获取活动详情
router.get('/detail/:id',carController.GetCarDetail);

module.exports = router;